package com.lovo.web.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.lovo.web.bean.DepositHistoryBean;
import com.lovo.web.mapper.IDepositHistoryMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("dphc")
public class DepositHistoryController {
    @Autowired
    IDepositHistoryMapper depositHistoryMapper;

    @RequestMapping("findByName/{userName}")
    public List<DepositHistoryBean> findByName(@PathVariable("userName") String userName) {
        QueryWrapper<DepositHistoryBean> qw = new QueryWrapper<>();
        qw.eq("fk_userName",userName).orderByDesc("pk_shId");
        return depositHistoryMapper.selectList(qw);
    }
}
